#include <iostream>

using namespace std;

char f[3][3];

int main()
{
	for (int i = 0; i < 3; i ++ )
		for (int j = 0; j < 3; j ++ )
			cin >> f[i][j];
			
	if (f[0][0] == f[2][2] && f[0][1] == f[2][1] &&
		f[2][0] == f[0][2] && f[1][0] == f[1][2]) 
		puts("YES");
	else
		puts("NO");
		
	return 0;
}